// import Cookies from 'js-cookie'

export const TokenKey = 'Authorization';
const storage = window.localStorage;
const sessionStorage = window.sessionStorage;

export function getItem(key) {
  // return Cookies.get(key || TokenKey);
  return storage.getItem(key);
}

export function setItem(key,value) {
  // return Cookies.set(...params)
  return storage.setItem(key,value);
}

export function removeItem(key) {
  // return Cookies.remove(key)
  return storage.removeItem(key);
}

export function removeItems(keys = '') {
  if (Array.isArray(keys)) {
    keys.forEach(key => {
      removeItem(key);
    })
  }
}


export function getSessionItem(key) {
  return sessionStorage.getItem(key);
}

export function setSessionItem(key,val) {
  return sessionStorage.setItem(key,val);
}
